package ua.study.selenium;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.annotations.Test;

public class AddingFilmsAbsentFields extends ua.study.selenium.pages.TestBase {

	@Test
	public void testNotAllFieldsFilled() throws Exception {
		
		WebElement addMovieBtn = driver.findElement(By
				.cssSelector("a[href*='add']"));
		addMovieBtn.click();

		WebElement imdbNumber = driver.findElement(By
				.cssSelector("[name='imdbid']"));
		imdbNumber.sendKeys("2209418");

		WebElement year = driver.findElement(By.cssSelector("[name='year']"));
		year.sendKeys("2013");

		WebElement saveBtn = driver.findElement(By.id("submit"));
		saveBtn.click();

		driver.findElement(By.cssSelector(".required.error"));
	}
}
